package sung.extendmethod;

import java.util.ArrayList;

public class ParentFindNumber {

	int[] numberList = { 34, 26, 98, 76, 32, 15, 56, 24, 5, 7, 14 };

	public ArrayList<Integer> findUserReqNO(int userReqNO) {
		int findNO = 999;
		int tempValue = 999;
		ArrayList<Integer> result = new ArrayList<Integer>();
		
		for (int i = 0; i < numberList.length; i++) {
			int checkVal = (numberList[i] - userReqNO < 0) ? -(numberList[i] - userReqNO): numberList[i] - userReqNO;
			if (checkVal <= tempValue) {
				result.add(numberList[i]);
				tempValue = checkVal;
			}
		}
		
		return result;
	}
}